package org.github.manx98.jlibhac.tools.fs;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/3 1:42
 */
public enum GameCardAttribute {
    None("None"),
    AutoBootFlag("AutoBootFlag"),
    HistoryEraseFlag("HistoryEraseFlag"),
    RepairToolFlag("RepairToolFlag"),
    DifferentRegionCupToTerraDeviceFlag("DifferentRegionCupToTerraDeviceFlag"),
    DifferentRegionCupToGlobalDeviceFlag("DifferentRegionCupToGlobalDeviceFlag"),

    HasCa10CertificateFlag("HasCa10CertificateFlag");
    private final String name;

    GameCardAttribute(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    public static GameCardAttribute valueOf(int value) {
        switch (value) {
            case 0:
                return GameCardAttribute.None;
            case 1:
                return GameCardAttribute.AutoBootFlag;
            case 1 << 1:
                return GameCardAttribute.HistoryEraseFlag;
            case 1 << 2:
                return GameCardAttribute.RepairToolFlag;
            case 1 << 3:
                return GameCardAttribute.DifferentRegionCupToTerraDeviceFlag;
            case 1 << 4:
                return GameCardAttribute.DifferentRegionCupToGlobalDeviceFlag;
        }
        return null;
    }
}
